package bsts.view.user;

import java.awt.BorderLayout;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.awt.event.WindowListener;

import javax.swing.JFrame;

import bsts.application.BSTSApplication;

public class LoginWindow extends JFrame {

	private static final long serialVersionUID = 1L;

	private BSTSApplication manager;
	private LoginPanel loginPanel;

	private WindowListener windowListener = new WindowAdapter() {
		public void windowClosing(WindowEvent e) {
			manager.shutdown();
		}
	};

	public LoginWindow(BSTSApplication manager) {
		super("Billing System for Telephone Services");
		this.manager = manager;

		loginPanel = new LoginPanel(manager);

		this.setLayout(new BorderLayout());
		this.add(loginPanel, BorderLayout.CENTER);
		this.addWindowListener(windowListener);
	}

}
